package com.gdc.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Description: Config 配置类
 * @author: gdc
 * @date: 2021/2/1
 * @version 1.0
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * 注入 RestTemplate
     *
     * | @LoadBalanced                      赋予 RestTemplate 负载均衡功能
     */
    @LoadBalanced
    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
